<template>
  <zh-form :model="state.wtTaskLog" label-width="150px">
    <zh-form-date prop="workDate" label="工作日期" format="YYYY-MM-DD"
                  :span="24" v-model="state.wtTaskLog.workDate"></zh-form-date>
    <zh-form-input
        :span="24"
        prop="workContent"
        label="工作内容"
        type="textarea" :row="5"
        v-model="state.wtTaskLog.workContent"
    ></zh-form-input>
  </zh-form>
</template>

<script lang="ts" setup name="wtTaskLogForm">
import {reactive, defineProps, onMounted} from "vue";

const props = defineProps({
  wtTaskLog: {
    type: Object,
    required: false,
    default: () => {
      return undefined;
    },
  },
})

const state = reactive({
  wtTaskLog: {
    workDate: undefined,
    workContent: undefined
  }
})

const getData = ()=>{
  return state.wtTaskLog;
}

onMounted(() => {
  if(props.wtTaskLog){
    state.wtTaskLog = JSON.parse(JSON.stringify(props.wtTaskLog));
  }
});

defineExpose({
  getData
})

</script>

<style scoped>

</style>